'libtgfx - Threaded Graphics library for FreeBASIC
'Copyright (C) 2013  Ebben Feagan <sir@mud.owlbox.net>
'
'This library is free software; you can redistribute it and/or
'modify it under the terms of the GNU Lesser General Public
'License as published by the Free Software Foundation; either
'version 2.1 of the License, or (at your option) any later version.
'
'This library is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
'Lesser General Public License for more details.
'
'You should have received a copy of the GNU Lesser General Public
'License along with this library; if not, write to the Free Software
'Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

#include once "tgfx.bi"
#include once "tgfx-priv.bi"


namespace tgfx.drawing



    sub print(  byval dest as any ptr = 0, _
                byref s as const string, _
                byval l as Coord _
            ) export
        Comm->send( new Message(_MPRINT,new MData(new str_data(s,dest,l),@str_d_free)) )
    end sub

    sub line(   byval dest as any ptr = 0, _
                byval first as Coord, _
                byval sec as Coord, _
                byval c as uinteger = rgb(255,255,255), _
                byval box as bool = false, _
                byval filled as bool = false _
            ) export

        Comm->send( new Message(_MLINE,new MData(new line_data(dest,first,sec,c,box,filled),@null_free)) )

    end sub

    sub circle( byval dest as any ptr = 0, _
                byval l as Coord, _
                byval r as integer, _
                byval c as uinteger = rgb(255,255,255), _
                byval filled as bool = false _
            ) export

        Comm->send( new Message(_MCIRCLE,new MData(new line_data(dest,l,Coord(r,0),c,filled,filled),@null_free)) )
    end sub

    sub plot(   byref cmdstr as const string, byval dest as any ptr = 0 ) export
        Comm->send( new Message(_MDRAW,new MData(new str_data(cmdstr,dest),@str_d_free)) )
    end sub
end namespace
